package com.shwread.android.ui.customview;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.webkit.WebView;


public class TouchWebView
        extends
        WebView
{
	private boolean isFirst = true;
	private int     scrollY;
	
	public TouchWebView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}
	
	public TouchWebView(Context context) {
		super(context);
	}
	
	public void setScrollY(int y) {
		scrollY = y;
	}
	
	@Override
	public boolean onTouchEvent(MotionEvent event) {
		switch (event.getAction()) {
			case MotionEvent.ACTION_MOVE:
			case MotionEvent.ACTION_DOWN:
				if (isFirst)
				{
					isFirst = false;
					return false;
				}
				else return super.onTouchEvent(event);
			case MotionEvent.ACTION_UP:
				return super.onTouchEvent(event);
		}
		
		return super.onTouchEvent(event);
	}
}
